hysop.operator.penalization module

@file penalization.py .. currentmodule:: hysop.operator.penalization

  • Penalization : standard penalisation (not implemented yet)

  • PenalizeVorticity : vorticity formulation

See details in penalisation section of HySoP user guide.

class hysop.operator.penalization.PenalizeVelocity(implementation=None, base_kwds=None, candidate_input_tensors=None, candidate_output_tensors=None, **impl_kwds)[source]

Bases: ComputationalGraphNodeFrontend

Solve f{eqnarray*} frac{partial w}{partial t} &=& lambdachi_snablatimes(v_D - v) f} using penalization.

Parameters:
  • obstacles (dict or list of Field) – sets of geometries on which penalization must be applied

  • velocity (field) – input velocity

  • coeff (ScalarParameter, optional) – penalization factor (flambdaf) applied to all geometries.

  • ubar (TensorParameter, optional) – Solid velocity (default to 0)

  • formulation (PenalizationFormulation) – Solving penalization either with IMPLICIT scheme or EXACT solution

  • variables (dict) – dictionary of fields as keys and topologies as values.

  • dt (ScalarParameter) – Timestep parameter that will be used for time integration.

  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • kwds – Keywords arguments that will be passed towards implementation poisson operator __init__.

  • Set::

  • {coeff1 (obstacles =)

  • None (coeff =)

  • subset. (to apply a different coefficient on each)

  • Set::

  • [obs1 (obstacles =)

  • obs2

  • ...]

  • some_value (coeff =)

  • Warning (coeff as a function is not yet implemented!!)

classmethod default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

classmethod implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.

class hysop.operator.penalization.PenalizeVorticity(obstacles, variables, velocity, vorticity, dt, coeff=None, ubar=None, formulation=None, implementation=None, **kwds)[source]

Bases: ComputationalGraphNodeFrontend

Solve f{eqnarray*} frac{partial w}{partial t} &=& lambdachi_snablatimes(v_D - v) f} using penalization.

Parameters:
  • obstacles (dict or list of Field) – sets of geometries on which penalization must be applied

  • velocity (field) – input velocity

  • vorticity (field,) – output vorticity

  • coeff (ScalarParameter, optional) – penalization factor (flambdaf) applied to all geometries.

  • ubar (TensorParameter, optional) – Solid velocity (default to 0)

  • formulation (PenalizationFormulation) – Solving penalization either with IMPLICIT scheme or EXACT solution

  • variables (dict) – dictionary of fields as keys and topologies as values.

  • dt (ScalarParameter) – Timestep parameter that will be used for time integration.

  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • kwds – Keywords arguments that will be passed towards implementation poisson operator __init__.

Notes

velocity is not modified by this operator. vorticity is an in-out parameter.

Set:

obstacles = {coeff1: obs1, coeff2: obs2, …} coeff = None

to apply a different coefficient on each subset. Set:

obstacles = [obs1, obs2, …] coeff = some_value

Warning : coeff as a function is not yet implemented!!

classmethod default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

classmethod implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.